package com.baizhi.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("cmfz_banner")
public class CmfzBanner implements Serializable {
    /*CREATE TABLE `cmfz_banner` (
            `banner_id` int(11) NOT NULL AUTO_INCREMENT,
  `banner_image_url` varchar(200) DEFAULT NULL,
  `banner_old_name` varchar(50) DEFAULT NULL COMMENT '原有名称',
            `banner_state` int(10) DEFAULT NULL, 0正常  1禁用
  `banner_date` datetime DEFAULT NULL COMMENT '上传时间',
            `banner_description` varchar(200) DEFAULT NULL,
    PRIMARY KEY (`banner_id`)*/
    @TableId(value = "banner_id",type = IdType.AUTO)
    private Integer bannerId;
    @TableField("banner_image_url")
    private String bannerImageUrl;
    @TableField("banner_old_name")
    private String bannerOldName;
    @TableField("banner_state")
    private Integer bannerState;
    @TableField("banner_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd") //接收日期的格式
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd hh:mm:ss") //响应json的日期格式
    private Date bannerDate;
    @TableField("banner_description")
    private String bannerDescription;

}
